home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_getgemgreen.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  123 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_GetGemGreen.cog
  4. #
  5. # [RT] [TL]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15. message        startup
  16.  
  17.  
  18. # Change these variables ONLY!
  19. # -------------------------------------------------------------------
  20.  
  21. # Use in_pickup_low or in_pickup_med for the "get" keyframe
  22. keyframe    get=in_pickup_med.key    local
  23. #keyframe    get=in_reach_high.key    local
  24.  
  25. # Item-specific voice line
  26. sound        foundSnd=INXJ193.wav    local
  27.  
  28. # Item bin number
  29. int            bin=95                    local
  30. thing        target                            # Tagert ghost for offset.    
  31.  
  32.  
  33. # Don't touch!
  34. # -------------------------------------------------------------------
  35.  
  36. cog            talkCog                    local
  37.  
  38. thing        player                    local
  39. thing        item
  40.  
  41. end
  42.  
  43. # ===================================================================
  44.  
  45. code
  46.  
  47. startup:
  48.  
  49. player = GetLocalPlayerThing();
  50.  
  51. return;
  52.  
  53. # -------------------------------------------------------------------
  54. activated:
  55.  
  56.     # Check to see if player is holding something. 
  57.     if (GetCurItem(player) != 0)
  58.         {
  59.         return;
  60.         }
  61.  
  62.     player = GetSourceRef();
  63.  
  64.     # Disable player controls and stuff
  65.     if (MakeMeStop() == -1)
  66.         return;
  67.     DeselectWeaponWait(player);
  68.  
  69.     # Make sure this pickup is valid
  70.     if (GetInv(player, bin) < GetInvMax(player, bin))
  71.     {
  72.         StartCutscene(0);
  73.  
  74.         # Capture player so we get callback message
  75.         CaptureThing(player);
  76.         # Start the animation
  77.         PlayKey(player, get, 5, 0x12, 0); 
  78.     }
  79.     else
  80.     {
  81.         ClearActorFlags(player, 0x200000);
  82.         return;
  83.     }
  84.  
  85.     # Call the Pickup Lines cog
  86.     talkCog = GetCogByIndex(0);
  87.     SendMessage(talkCog, 27);
  88.  
  89.     # Set up the camera
  90.     SetExtCamOffsetToThing(target);
  91.  
  92.     return;
  93.  
  94. # -------------------------------------------------------------------
  95.  
  96. callback:
  97.  
  98.     ReleaseThing(player);
  99.  
  100.     # Get rid of the item
  101.     DestroyThing(item);
  102.     
  103.     # Add to inventory
  104.     ChangeInv(player, bin, 1.0);
  105.     SetInvAvailable(player, bin, 1);
  106.     JonesInvItemChanged(bin);
  107.  
  108.     # Wait a bit, then start the voice line
  109.     Sleep(1.0);
  110.     PlayVoice(player, foundSnd, 1.0, 0);
  111.  
  112.     # Reset the camera
  113.     RestoreExtCam();
  114.  
  115.     # Enable player control
  116.     ClearActorFlags(player, 0x200000);
  117.     EndCutscene();
  118.  
  119.     return;
  120.  
  121. end
  122.  
  123.